package codetop.microsoft.T55;

/**
 * @Author: 18362
 * @Create: 2022-08-16 10:43:20 星期二
 */
class Solution {
    public boolean canJump(int[] nums) {
        int range = 0;
        for (int i=0; i<nums.length; ++i) {
            if (range >= nums.length-1)
                return true;
            if (range < i)
                return false;
            range = Math.max(range, i + nums[i]);
        }
        return true;
    }
}